Favicon

You are here: Home > API Reference > App Distribution > Application Integration Tokens > Add new token

Add new token

Required Permission: mad.application.token.create

Add new token

POST
https://api.applivery.io/v1/organizations/{organizationId}/apps/{applicationId}/tokens
curl -X POST "https://api.applivery.io/v1/organizations/{organizationId}/apps/{applicationId}/tokens" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "description": "string",
  "scopes": [
    "sdk"
  ]
}'
const response = await fetch("https://api.applivery.io/v1/organizations/{organizationId}/apps/{applicationId}/tokens", {
  method: "POST",
  headers: {
    Authorization: "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "description": "string",
    "scopes": [
      "sdk"
    ]
  }),
});

const data = await response.json();
import requests

response = requests.post(
    "https://api.applivery.io/v1/organizations/{organizationId}/apps/{applicationId}/tokens",
    headers={"Authorization": "Bearer <YOUR_API_KEY>"},
    json={
      "description": "string",
      "scopes": [
        "sdk"
      ]
    },
)

data = response.json()

Request

Send your API key in the request header authorization
Example: Authorization: Bearer <token>

organizationId string
required
Match pattern: ^(([a-fA-F0-9]{24})|([a-zA-Z0-9\\-]{3,}))$
applicationId string
required
Match pattern: ^(([a-fA-F0-9]{24})|([a-zA-Z0-9\\-]{3,}))$

Body Params application/json
description string optional
≤ 1000 characters
scopes array [string] optional
{
    "description": "string",
    "scopes": [
        "sdk"
    ]
}

Responses

200 Response application/json
status boolean optional
data object optional
id string optional
Match pattern: ^[a-fA-F0-9]{24}$
organization string optional
Match pattern: ^[a-fA-F0-9]{24}$
application string optional
Match pattern: ^[a-fA-F0-9]{24}$
description string optional
≤ 1000 characters
bearer string optional
≤ 128 characters
scopes array [string] optional
{
    "status": true,
    "data": {
        "id": "string",
        "organization": "string",
        "application": "string",
        "description": "string",
        "bearer": "string",
        "scopes": [
            "sdk"
        ]
    }
}
401 Response application/json
status boolean optional
false
error object optional
code number optional
4004
message string optional
Invalid Token
{
    "status": false,
    "error": {
        "code": 4002,
        "message": "No auth token"
    }
}
404 Response application/json
status boolean optional
false
error object optional
code number optional
3001
message string optional
Entity not found
{
    "status": false,
    "error": {
        "code": 3001,
        "message": "Entity not found"
    }
}